package pl.koziolekweb.javafx.twitter;

import net.unto.twitter.Api;
import net.unto.twitter.Api.Builder;

public abstract class Tweet {

	private static Api twitterApi;

	public static void init(String username, String password) {
		Builder builder = Api.builder().username(username).password(password);
		twitterApi = builder.build();
	}

	public static void add(String message) {
		if (twitterApi == null) {
			throw new IllegalStateException("You are not login");
		}
		twitterApi.updateStatus(message).build().post();
	}
}
